Here's how you might use the program to monitor your car by configuring the program to save an image when movement is detected inside a specific zone...
The actions are documented below:
Download Move Action and source code
note - to configure the various options you need to edit the configuration file "moveaction.conf" with a text editor such as Notepad - I've put comments/examples against all the entries to make it easier to configure the settings. I occasionally think about making a proper configuration screen but so far I haven't got around to it...
1. Locking your PC
I got the inspiration for this functionality from Cryptonomicon where Randy Waterhouse is on an aeroplane using a "marvelously paranoid piece of software invented by John Cantrell" called OrdoEmacs, which is "coupled to a screensaver that uses the little built-in CCD camera in the laptop to check to see if you are actually there. It canÆt recognize your face, but it can tell whether or not a vaguely human-shaped form is sitting in front of it, and if that vaguely human-shaped form goes away, even for a fraction of a second, it will drop into a screen-saver that will blank the display and freeze the machine until such time as you type in a password..."
To enable system locking, edit "moveaction.conf" and set "lockOnMovement=true". The program will now monitor the frames from the webcam and will lock the system if movement is detected. However, to give you a chance to cancel the lock, the program will start a countdown which you can stop by clicking the cancel button. The countdown time is configured by setting "cancelPeriod=N" (where N is the number of seconds the program will countdown before locking). When the countdown reaches zero your PC will be locked and you will need to re-enter your Windows password to activate it. The system locking is a standard Windows API call and is perfectly safe, it's just the same as if you locked the system with CTRL-ALT-DEL.
You can use the program as a simple CCTV system - whenever the program detects any movement it will save a JPG image to disk. To enable image capture, edit "moveaction.conf" and set "saveJpegOnMovement=true". The program can also mail the images to an email address - this is in case somebody realises they are being caught on camera and decides to steal/destroy your PC. If you configure this option correctly, there should be a couple of shots of the guilty person on their way to your email account by the time they have figured out they are being filmed. You need to set "sendViaEmail=true" in the file moveaction.conf and set your SMTP server e.g. email.host=smtp.aol.com (get this from your ISP). Then change "email.to" to your email address and you're done. Note that some ISPs may not appreciate it if you end up sending 10 emails a second to your account! (you can configure all the intervals in the conf file). It is also possible to configure the program to upload the images to an FTP server, just set "sendViaFtp=true" in moveaction.conf and configure the details of the FTP server.
This was another idea from Cryptonomicon: Hacker Randy Waterhouse is in a meeting with a bunch of sinister business people who are about to view a demo on his laptop but he has no idea who they are....and has an idea how to find out...
What can Randy do right now to enhance shareholder value? Intrigue is not his specialty; heÆll leave that to Avi. Instead, he tunes out the meeting, opens up his laptop, and begins to hack.
Hacking is an overly glorious word for this. Everyone in Epiphyte Corp. has a laptop with a tiny built-in video camera, so that they can do long-distance videoconferencing. Avi insisted on it. The camera is almost invisible: just an orifice a couple of millimeters across, mounted in the top center of the frame that surrounds the screen. It doesnÆt have a lens as suchùitÆs a camera in the oldest sense, a camera obscura. One wall contains the pinhole and the opposite wall is a silicon retina.
Randy has the source code ù the original program ù for the videoconferencing software. It is reasonably clever in its use of bandwidth. It looks at the stream of frames (individual still images) coming from the pinhole camera and notices that, although the total amount of data in those frames is rather large, the difference from one frame to the next is tiny. It would be altogether different if Frame 1 were a talking head and Frame 2, a fraction of a second later, were a postcard shot of a Hawaiian beach and Frame 3 a diagram of a printed circuit and Frame 4 a closeup of a dragonflyÆs head. But in fact, each frame is a talking headùthe same personÆs head, with minor changes in position and expression. The software can save on precious bandwidth by mathematically subtracting each new frame from the previous one (since, to the computer, each image is just a long number) and then transmitting only the difference.
What it all means is that this software has a lot of built-in capabilities for comparing one image with another, and gauging the magnitude of the difference from one frame to the next. Randy doesnÆt have to write that stuff. He just has to familiarize himself with these already-existing routines, learn their names and how to use them, which takes about fifteen minutes of clicking around.
Then he writes a little program called Mugshot that will take a snap shot from the pinhole camera every five seconds or so, and compare it to the previous snapshot, and, if the difference is large enough, save it to a file.
Randy slides the computer over to John, who runs through the demo (there should be a mug shot of John Cantrell stored on the hard disk now). One by one, members of the other delegations run the demo.....
The program can be configured to launch any other application when movement is detected. To enable this setting, just enter the full path of the program you want to run in the setting "launchOnMovement" in the file moveaction.conf, e.g. launchOnMovement=c:\apps\someprogram.exe You can also configure the working directory that your application starts in by setting "workingDirectory" to the directory you require.
The program can play a sound file when movement is detected. The sound file must be a WAV file (e.g. mysound.wav), and you enter the name of the file in the setting "playSoundOnMovement", e.g. "playSoundOnMovement=c:\sounds\alarm.wav".
By default the program captures images from your webcam. However, it can be configured to retrieve the images from an external URL by setting the "source" property in "moveaction.conf" to the URL of a jpg file, e.g. source=http://mywebsite.com/images/webcam.jpg. This makes it possible to link two instances of Move Action together, e.g. you could set up your webcam at home to upload images to a web site (using the FTP upload feature), then use a second instance of Move Action to grab the images and alert you wherever you happen to be if any movement is detected.
If you are using the webcam option, there is a button on the toolbar that allows you to configure the webcam (this brings up the manufacturer's dialog).
You can configure Move Action to only detect movement within a particular area of the image. To do this, click the button on the top panel, and a blue rectangle will appear within the image. The program will now only detect movement within this zone. To position the detection zone, drag it around using the blue border. To resize the zone, hold the shift key down and drag the bottom-right corner border of the zone. Note that you cannot move or resize the detection zone outside of the main image. If you click the zone button again the blue zone will disappear, and the entire screen is monitored instead.
The movement sensitivity is controlled using the slider where you can adjust the value that will cause movement detection to trigger. This is basically a percentage of the image that must have changed for movement detection to be triggered. For example, setting this to 1 means that only 1% of pixels needs to change in order to trigger movement detection (this will trigger constantly), whereas setting this to 100 means that every pixel needs to change and therefore movement detection is very unlikely.
Bugs/Gotchas:
For some reason, the button that allows you to cancel the system lock is not displayed when the program restores from the system tray. I have no idea why this is, as you can still press ESC to cancel the lock. The button is displayed if you set "minimizeToTray=false" (the program minimizes to the taskbar).
If you have any questions or want to report a bug please drop me a line at
Sorry, but a Javascript-enabled browser is required to email me.
Move Action 1.8
Move Action 1.7
Move Action 1.6
Move Action 1.5